
public class InstrumentationFilterFramework extends FilterFramework{
	/***********************************************************************************
	*	This class adds methods and helper information specific to the instrumentation business case
	*	since these methods are specific only to the instrumentation business case, they are provided
	*	as a subclass to FilterFramework
	***********************************************************************************/

	protected void writeMeasurementToFilterOutputPort(Measurement mType, byte[] b){
		//writes the measurement with the id and byte information
		this.writeByteArrayFilterOutputPort((this.intToByteArray(mType.getID())));
		this.writeByteArrayFilterOutputPort(b);
	}
	protected String writeMeasurementToFilterOutputPort(Measurement mType, Long mLong){
		//this is a convenience method to convert the measurement into the a byte array for transport
		//returns String for debugging
		switch(mType){
		case TIME:
			writeMeasurementToFilterOutputPort(mType, this.longToByteArray(mLong.longValue()));
			break;
		}
		return Long.toString(mLong);
	}
	protected String writeMeasurementToFilterOutputPort(Measurement mType, Double mDouble){
		//this is a convenience method to convert the measurement into the a byte array for transport
		//returns String for debugging
		switch(mType){
			case VELOCITY:
				writeMeasurementToFilterOutputPort(mType, this.doubleToByteArray(mDouble.doubleValue()));
				break;
			case ALTITUDE:
				writeMeasurementToFilterOutputPort(mType, this.doubleToByteArray(mDouble.doubleValue()));
				break;
			case PRESSURE:
				writeMeasurementToFilterOutputPort(mType, this.doubleToByteArray(mDouble.doubleValue()));
				break;
			case TEMPERATURE:
				writeMeasurementToFilterOutputPort(mType, this.doubleToByteArray(mDouble.doubleValue()));
				break;
			case PITCH:
				writeMeasurementToFilterOutputPort(mType, this.doubleToByteArray(mDouble.doubleValue()));
				break;
		}
		return Double.toString(mDouble);
	}
	protected enum Measurement{
		TIME(0),
		VELOCITY(1),
		ALTITUDE(2),
		PRESSURE(3),
		TEMPERATURE(4),
		PITCH(5);
		
		private int id;
		Measurement(int id){
			this.id=id;
		}
		public int getID(){
			return id;
		}
	}
}
